<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>侧边菜单</title>
</head>
<body>
<div class="layui-side layui-side-menu" role="navigation" th:fragment="menuLeft">
    <div class="layui-side-scroll">
        <!--logo渲染-->
        <div class="layui-logo" lay-href=""><span>某某平台</span></div>
        <!--三级菜单渲染-->
        <ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu"
            lay-filter="layadmin-system-side-menu">
            <li class="layui-nav-item layui-nav-itemed">
                <a href="javascript:;" class="MenuDDLink" data-href="/index/main">
                    <i class="layui-icon layui-icon-home"></i>
                    <cite> <span th:text="${menus.getName()?:'首页'}"></span></cite>
                </a></li>
            <li class="layui-nav-item" th:if="${menus.getChild().size()>0}" th:each="menu:${menus.getChild()}">
                <a href="javascript:;" th:if="${menu.getChild().size()>0}">
                    <i class="layui-icon layui-icon-menu-fill"></i>
                    <cite> <span th:text="${menu.getName()}">一级菜单</span></cite>
                    <span class="layui-nav-more"></span>
                </a>
                <a href="javascript:;" th:attr="data-href=${menu.getUrl()} " th:if="${menu.getChild().size()==0}"
                   class="MenuDDLink"> <i class="layui-icon layui-icon-link"></i>
                    <span th:text="${menu.getName()}"></span></a>
                <!--二级菜单列表-->
                <dl class="layui-nav-child" th:if="${menu.getChild().size()>0}">
                    <!--二级菜单-->
                    <dd th:each="menu2: ${menu.getChild()}">
                        <!--页面二级菜单-->
                        <th:block th:if="${menu2.getChild()==null || menu2.getChild().size() <=0}">
                            <a href="javascript:;" th:attr="data-href=${menu2.getUrl()} " class="MenuDDLink">
                                <i class="layui-icon layui-icon-link"></i>
                                <span th:text="${menu2.getName()}"></span></a>
                        </th:block>
                        <!--目录二级菜单-->
                        <th:block th:if="${menu2.getChild() !=null && menu2.getChild().size() >0}">
                            <a href="javascript:;"><span>&emsp;&emsp;</span><span th:text="${menu2.getName()}"></span><span
                                    class="layui-nav-more"></span></a>
                            <dl class="layui-nav-child">
                                <!--三级菜单-->
                                <th:block th:each="menu3: ${menu2.getChild()}">
                                    <dd><a href="javascript:;" th:attr="data-href=${menu3.getUrl()} "
                                           class="MenuDDLink">
                                        <i class="layui-icon layui-icon-link"></i>
                                        <span th:text="${menu3.getName()}"></span></a>
                                    </dd>
                                </th:block>
                            </dl>
                        </th:block>
                    </dd>
                </dl>
            </li>
        </ul>
    </div>
</div>

</body>
</html>
